package interviewpreparationkit.sorting

import org.junit.jupiter.api.Test
import redirectSystemIn
import redirectSystemOut
import java.util.*

class CountSwapsTests {
    @Test
    fun countSwapsTest() {
        redirectSystemIn(this.javaClass) {
            val scan = Scanner(System.`in`)

            redirectSystemOut {
                while (scan.hasNextLine()) {

                    val n = scan.nextLine().trim().toInt()

                    val a = scan.nextLine().split(" ").map { it.trim().toInt() }.toTypedArray()

                    countSwaps(a)

                    for (i in 0 until 3) {
                        it.add(scan.nextLine().trim())
                    }
                }
            }
        }
    }
}